#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   main.py
@Time    :   2020/08/06 04:02:13
@Author  :   中箭的吴起 
@Version :   1.0
@Contact :   solider245@gmail.com
@License :   (C)Copyright 2017-2018, Liugroup-NLPR-CASIA
@Desc    :   None
'''

# here put the import lib
import pandas as pd

# 爬取网址
#%%
for i in range(1,191):
    url =f'https://s.askci.com/stock/a/0-0?reportTime=2020-03-31&pageNum={str(i)}'
    tb = pd.read_html(url)[3]
    #print(tb)
    tb.to_csv('./A股公司营业收入排行榜(2020年).csv', mode='a', encoding='utf\-8', header=1, index=0)




    #print(url)
    #tb = pd.read_html(url_list)[3]
#print (tb)




#%%
# 找到所需爬取的表格 \[0\]代表取第一个表格



